package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the CONTRATO database table.
 * 
 */
@Entity
@Table(name="CONTRATO")
public class Contrato implements Serializable {
	private static final long serialVersionUID = 1L;
	private long contratoId;
	private String estado;
	private Date fecCrea;
	private Date tsCrea;
	private Date tsUltModif;
	private String usrCrea;
	private String usrUltModif;
	private Set<AudAfiliacion> audAfiliacions;
	private VerContrato verContrato;
	private PeJuri peJuri;
	private Cuenta cuenta;

    public Contrato() {
    }


	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="CONTRATO_ID", unique=true, nullable=false)
	public long getContratoId() {
		return this.contratoId;
	}

	public void setContratoId(long contratoId) {
		this.contratoId = contratoId;
	}


	@Column(nullable=false, length=1)
	public String getEstado() {
		return this.estado;
	}

	public void setEstado(String estado) {
		this.estado = estado;
	}


    @Temporal( TemporalType.DATE)
	@Column(name="FEC_CREA", nullable=false)
	public Date getFecCrea() {
		return this.fecCrea;
	}

	public void setFecCrea(Date fecCrea) {
		this.fecCrea = fecCrea;
	}


    @Temporal( TemporalType.DATE)
	@Column(name="TS_CREA", nullable=false)
	public Date getTsCrea() {
		return this.tsCrea;
	}

	public void setTsCrea(Date tsCrea) {
		this.tsCrea = tsCrea;
	}


    @Temporal( TemporalType.DATE)
	@Column(name="TS_ULT_MODIF", nullable=false)
	public Date getTsUltModif() {
		return this.tsUltModif;
	}

	public void setTsUltModif(Date tsUltModif) {
		this.tsUltModif = tsUltModif;
	}


	@Column(name="USR_CREA", length=15)
	public String getUsrCrea() {
		return this.usrCrea;
	}

	public void setUsrCrea(String usrCrea) {
		this.usrCrea = usrCrea;
	}


	@Column(name="USR_ULT_MODIF", length=15)
	public String getUsrUltModif() {
		return this.usrUltModif;
	}

	public void setUsrUltModif(String usrUltModif) {
		this.usrUltModif = usrUltModif;
	}


	//bi-directional many-to-one association to AudAfiliacion
	@OneToMany(mappedBy="contrato")
	public Set<AudAfiliacion> getAudAfiliacions() {
		return this.audAfiliacions;
	}

	public void setAudAfiliacions(Set<AudAfiliacion> audAfiliacions) {
		this.audAfiliacions = audAfiliacions;
	}
	

	//bi-directional many-to-one association to VerContrato
    @ManyToOne
	@JoinColumn(name="VER_CONTRATO_ID", nullable=false)
	public VerContrato getVerContrato() {
		return this.verContrato;
	}

	public void setVerContrato(VerContrato verContrato) {
		this.verContrato = verContrato;
	}
	

	//bi-directional many-to-one association to PeJuri
    @ManyToOne
	@JoinColumn(name="PE_JURI_ID")
	public PeJuri getPeJuri() {
		return this.peJuri;
	}

	public void setPeJuri(PeJuri peJuri) {
		this.peJuri = peJuri;
	}
	

	//bi-directional many-to-one association to Cuenta
    @ManyToOne
	@JoinColumn(name="CUENTA_ID", nullable=false)
	public Cuenta getCuenta() {
		return this.cuenta;
	}

	public void setCuenta(Cuenta cuenta) {
		this.cuenta = cuenta;
	}
	
}